Skip to main content
Introduction

A new es_extended version might be incompatible with some "old" scripts

esx:getSharedObject deprecated

  • If you get error in F8 that getSharedObject is deprecated and you should replace it, follow these steps to fix it. You can choose between these options

If you will follow these steps you will be fine

  1. Add '@es_extended/imports.lua' to fxmanifest.lua of your script into client_scripts/sever_scripts/shared_scripts variable
fx_version 'cerulean'

game 'gta5'
version '1.0.0'
lua54 'yes'
shared_scripts { '@es_extended/locale.lua', 'locales/*.lua', 'config.lua' }
server_scripts { '@oxmysql/lib/MySQL.lua', 'server/*.lua' }
client_scripts { 'client/*.lua' }
  1. Replace getSharedObject for export es_extended['es_extended']:getSharedObject() (works for both client & server side)
TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  1. (NOT RECOMMENDED, but works also) In es_extended/server/common.lua & es_extended/client/common.lua replace esx:getSharedEvent as described bellow
AddEventHandler("esx:getSharedObject", function()
local Invoke = GetInvokingResource()
print(("[^1ERROR^7] Resource ^5%s^7 Used the ^5getSharedObject^7 Event, this event ^1no longer exists!^7 Visit https://documentation.esx-framework.org/tutorials/tutorials-esx/sharedevent for how to fix!"):format(Invoke))
end)